/*************************************************************************
 * gOkey - A tile based game for Gnome.                                  *
 * Copyright (C) 2008  Onur Aslan  <onuraslan@gmail.com>                 *
 *                                                                       *
 * This program is free software: you can redistribute it and/or modify  *
 * it under the terms of the GNU General Public License as published by  *
 * the Free Software Foundation, either version 3 of the License, or     *
 * (at your option) any later version.                                   *
 *                                                                       *
 * This program is distributed in the hope that it will be useful,       *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 * GNU General Public License for more details.                          *
 *                                                                       *
 * You should have received a copy of the GNU General Public License     *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. *
 *************************************************************************/

#include "config.h"

/* game constants */
#define TILE_MAX        106
#define PLAYER_MAX      4
#define SIDE_MAX        2
#define COLOR_MAX       4
#define SIDE_TILE_MAX   13
#define PLAYER_TILE_MAX 15

/* memcheck macro */
#define memcheck(ptr) if (ptr == NULL) exit (1);

typedef struct Tile {
  int order;
  /* which player have this tile */
  int pid;
  enum {
    BLACK, RED,
    BLUE,  YELLOW
  } color;
  enum {
    NORMAL, JOKER, FAKE_JOKER, CLOSED_TILE
  } type;
  struct {
    int x;
    int y;
    int width;
    int height; 
  } position;
  enum {
    STATIC,
    DRAGING
  } status;
} Tile;

typedef struct Player {
  char *name;
  enum {
    HUMAN,
    CPU
  } type;
  Tile **tiles;
  struct Player *next;
} Player;

typedef struct Game {
  enum {
    NOT_PLAYING,
    PLAYING
  } status;
} Game;

Tile *tiles;
Tile *joker;
Player *player;
Player *players;
Game *game;

/* game */
void init_game (void);

/* gui */
void change_status_bar_text (const char *msg);
